<!--
 * @Descripttion:
 * @version:
 * @Author: cxguo
 * @Date: 2020-06-25 14:56:10
 * @LastEditors: cxguo
 * @LastEditTime: 2020-11-12 15:04:24
-->
<template>
  <div>
    <el-container>
      <el-aside width="200px" class="border-gay" style="border-top:none">
        <cate-tree @node-click="handleNodeClick" />
      </el-aside>
      <el-main class="noPadding">
        <el-card shadow="never" class="oper-btn-card" style="border-top:none">
          <el-input
            v-model="insideSearchData.keywords"
            style="width: 300px"
            placeholder="按编号，名称，规格查询."
            @keydown.enter.native="btnSearch"
          >
            <el-button slot="append" icon="el-icon-search" type="primary" :loading="btnLoading.search" @click="btnSearch" />
          </el-input>
        </el-card>
        <div>
          $attrs: {{ $attrs }}
          <GoodsList
            ref="goodsList"
            v-bind="$attrs"
            :post-method="listGoodsMethod"
            :search-data="insideSearchData"
          />
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import { oftenuse } from '@/libs/mixins'
import { CateTree } from '@/views/bsd/goods/category'
import { exportApi } from './mixins'
import GoodsList from './goods-list'
import { listDataMore } from '@/api/goods/goods-sku.js'

export default {
  components: { GoodsList, CateTree },
  mixins: [oftenuse, exportApi],
  props: {
  },
  data() {
    return {
      listGoodsMethod: listDataMore,
      insideSearchData: {}
    }
  },
  computed: {
  },
  created() {
  },
  methods: {
    btnSearch() {
      this.getList()
    },
    getList() {
      this.$refs.goodsList.getListData()
    },
    handleNodeClick(data) {
      this.$set(this.insideSearchData, 'catId', data.id)
      this.getList()
    }
  }
}
</script>

<style>

</style>
